const { ccclass, property } = cc._decorator;

@ccclass
export default class LoginScene extends cc.Component {
    static Instance: LoginScene;

    @property(cc.Button)
    Button_guest: cc.Button = null;

    protected onLoad() {
        LoginScene.Instance = this;

        this.ShowOn();
    }

    ShowOn() {
        this.node.active = true;
        this.AddListener();

        this.On_Button_guest();
    }

    ShowOff() {
        this.node.active = false;
        this.RemoveListener();
    }

    AddListener() {
        this.Button_guest.node.on("click", this.On_Button_guest, this);
    }

    RemoveListener() {
        this.Button_guest.node.off("click", this.On_Button_guest, this);
    }

    private On_Button_guest() {
        console.log("登录")
        cc.director.loadScene("MainScene");
    }
}
